package com.sea.supply.mapper;

import com.sea.supply.entity.WareDistribute;
import com.sea.supply.entity.WareProduce;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *  接收单接口
 * @author 陈鸿飞
 * <br/>
 */
public interface WareDistributeMapper {

    /**
     * 新增
     * @param wareDistribute
     * @return
     */
    Integer insert(WareDistribute wareDistribute);

    /**
     * 查询可接收数量
     * @param wareProduce
     * @return
     */
    WareDistribute findReceiveNumber(WareProduce wareProduce);

    /**
     * 更新
     * @param wareDistribute
     * @return
     */
    Integer update(WareDistribute wareDistribute);

    Integer updateUseNumber(@Param("useNumber")Integer useNumber,@Param("id")Integer id);

    List<WareDistribute> getDistributeNumber(@Param("receiveSku")String receiveSku,@Param("receiveChannelName")String receiveChannelName);

    WareDistribute findById(Integer id);

    List<WareDistribute> findByCnd(WareDistribute wareDistribute);

    WareDistribute findBySkuChannelNo(WareDistribute wareDistribute);

    List<WareDistribute> findByDistributeReadyUse(@Param("receiveSku")String receiveSku,@Param("receiveChannelName")String receiveChannelName);

    Integer updateReadyUseNumber(@Param("produceReadyUse")Integer produceReadyUse,@Param("id")Integer id);

}